package puzzle
{
	import org.wak.action.IInteractable;
	import org.wak.character.AdventureCharacter;
	import org.wak.character.display.AbstractCharacterDisplay;
	import org.wak.main.PuzzleControllerBase;

	public class MyPuzzleController extends PuzzleControllerBase
	{
		private var mInteractionBehaviour:String = "" ;
		
		public function MyPuzzleController()
		{
			super();
		}
		
		public function UseISwordAndSIChest(pItemA:IInteractable, pItemB:IInteractable):void
		{
			trace("Puzzle controller UseISwordOnSIChest");
		}
		
		public function TalktoSecondChar(pChar:AbstractCharacterDisplay):void
		{
			trace("talking to "+ pChar.interactableId );
			var fPlayerChar:AdventureCharacter = mCharactersMngr.GetPlayerCharacter() ;
			fPlayerChar.MoveTo(pChar.interactionPointX, pChar.interactionPointY,StartFirstChat);
			mInteractionBehaviour = pChar.interactionBehaviour ;
		}
		
		public function LookatSecondChar(pChar:IInteractable):void
		{
			trace("LookatSecondChar");
			//mDialogMngr.DisplayInfo(pChar.description );
			mDialogMngr.StartDialog("DChat")
			
		}
		
		public function UseISwordAndSecondChar(pItemA:IInteractable, pItemB:IInteractable):void
		{
			//trace("UseISwordOnSecondChar");
			mDialogMngr.DisplayInfo("Is convenient not to kill nobody in town.");
		}
		
		private function StartFirstChat():void
		{
			trace("StartFirstChat");	
			var fPlayerChar:AdventureCharacter = mCharactersMngr.GetPlayerCharacter() ;
			fPlayerChar.characterDisplay.SetAnimBehaviour(mInteractionBehaviour);
			
			mDialogMngr.StartDialog("DFirstChat");
		}
		
	}
	
}